package com.gxa.logistics.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.sql.Date;
import java.time.LocalDate;

@Data
@ApiModel(value = "系统用户修改实体")
public class EmployeeUpdateDTO implements Serializable {

    @ApiModelProperty(name = "employeeId",notes = "员工ID",dataType = "String",required = true)
    @NotNull(message = "员工不能为空")
    private Integer employeeId;

    @ApiModelProperty(name = "employeeName",notes = "员工姓名",dataType = "String",required = true)
    @NotBlank(message = "员工姓名不能为空")
    @Size(min = 2, message = "员工姓名：请输入至少2个字符")
    private String employeeName;

    @ApiModelProperty(name = "phone",notes = "手机号码",dataType = "String",required = true)
    @NotBlank(message = "登录手机号码不能为空")
    @Pattern(regexp = "^1\\d{10}$",message = "手机号码格式不正确")
    private String phone;

    @ApiModelProperty(name = "username", notes = "用户名", dataType = "String", required = true)
    @NotBlank(message = "用户名不能为空")
    private String username;

    @ApiModelProperty(name = "role", notes = "用户名", dataType = "String", required = true)
    @NotBlank(message = "角色不能为空")
    private String role;

    @ApiModelProperty(name = "hireDate", notes = "入职日期", dataType = "LocalDate", required = true)
    @NotNull(message = "入职日期不能为空")
    private LocalDate hireDate;

    @ApiModelProperty(name = "termDate", notes = "离职日期", dataType = "LocalDate", required = false)
    private LocalDate termDate;

    @ApiModelProperty(name = "address", notes = "家庭住址", dataType = "String", required = false)
    @Size(max = 255, message = "家庭住址不能超过255个字符")
    private String address;

    @ApiModelProperty(name = "deptId",notes = "所属部门",dataType = "String",required = true)
    @NotNull(message = "所属部门")
    private Integer deptId;//所属部门

    @ApiModelProperty(name = "sex",notes = "性别",dataType = "String",required = true)
    @NotNull(message = "性别")
    @Range(min = 1,max = 2,message = "状态(1:男,2:女)")
    private String gender; //性别（1:男,2:女）
}
